<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%>
<%@include file="../common/jscss.jsp"%>
<%@include file="../common/selfCss.jsp"%>
<script type="text/javascript">
	$(function(){
		$("#modify_pass_form").validate({
			success : function(label) {
				label.text("").addClass("validate_success");
			},
			rules : {
				username : {
					required : true,
					minlength : 2,
					maxlength : 20
				},
				password : {
					required : true,
					minlength : 6,
					maxlength : 20
				},
				realname : {
					required : true,
					minlength : 2,
					maxlength : 20
				}
			},
			messages : {
				username : {
					required : "请输入名字",
					minlength : "请填写2个以上字",
					maxlength : "请填写20个以下的字"
				},
				password : {
					required : "请输入密码",
					minlength : "请填写6个以上字",
					maxlength : "请填写20个以下的字"	
				},
				realname : {
					required : "请输入真实姓名",
					minlength : "请填写2个以上字",
					maxlength : "请填写20个以下的字"	
				}
			},
			submitHandler : function() {
				$.post("/misc/admin/updateUser.htm", {
					id : $("#id").val(),
					username : $("#username").val(),
					password : $.trim($("#password").val()),
					realname : $("#realname").val(),
					description : $("#description").val()
				},function(data){
					if(data=="success"){
						parent.$.ligerDialog.success("更新成功！");
						parent.userGrid.loadData();
						parent.editUserDialog.close();
					}
					if(data=="error"){
						$.ligerDialog.warn("系统有点抽经，请稍候重试！");
					}
				});
			}
		});
	});
</script>
<form method="post" id="modify_pass_form" action="">
<input type="hidden" id="id" value="${user.id}">
		<table width="100%" class="def_t">
			<tr>
				<td>用户名：</td>
				<td><input type="text" id="username" name="username" value="${user.username}" readonly=true /></td>
			</tr>
			<tr>
				<td>用户密码：</td>
				<td><input type="password" id="password" name="password" value=""/></td>
			</tr>
			<tr>
				<td>真实姓名：</td>
				<td><input type="text" id="realname" name="realname" value="${user.realname}" readonly=true /></td>
			</tr>
			<tr>
				<td>用户描述：</td>
				<td><textarea id="description" name="description" cols="40" readonly=true>${user.description}</textarea></td>
			</tr>
			<tr>
				<td colspan="2">
					<button type="submit" >确定</button>
				</td>
			</tr>
		</table>
</form>
